Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple hosts configuration #258

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

mirromutth
Copy link
Contributor

@mirromutth mirromutth commented Mar 12, 2024

Motivation:

Support for multiple hosts configuration.

Resolves #89

It also resolves #255 because if the user uses multiple hosts we have to resolve the hostname and port ourselves

Modification:

  • Refactor host/unixSocket and add addHost to configure multiple hosts
  • Allow to use Mono.zip for user and password, because we have to receive and cache credential before we try to connect to multiple hosts
  • Add multiple hosts connection strategy
  • Add HA protocol support for multiple hosts
  • Allow to use DNS SRV records for HA protocol, like r2dbc:mysql+srv:loadbalance://my-db-1,my-db-2/test
  • Add autoReconnect/maxReconnects support, FailoverClient
  • Add failover events support and description
  • Add reconnection strategy
  • Add get back to primary host for default HA protocol, queriesBeforeRetrySource and secondsBeforeRetrySource

User can only configure one of:

  • host/port for a single host
  • addHost for multiple hosts, it will be auto-converted from ConnectionFactoryOptions.HOST
  • unixSocket for Unix Domain Socket.

Result:

Support multiple hosts configuration with HA protocol.

Support DNS SRV Records for HA protocol.

@mirromutth mirromutth added the enhancement New feature or request label Mar 12, 2024
@mirromutth mirromutth force-pushed the 89-featuresupports-multiple-host-configuration branch from 517cc4c to cfef3f1 Compare March 12, 2024 06:14
@mirromutth
Copy link
Contributor Author

@jchrys It is going to be a big feature, so I will mark it to 1.2.0

@mirromutth mirromutth added this to the 1.2.0 milestone Mar 12, 2024
@mirromutth mirromutth force-pushed the 89-featuresupports-multiple-host-configuration branch 5 times, most recently from b3114ae to 487fdd6 Compare March 18, 2024 02:20
@mirromutth mirromutth force-pushed the 89-featuresupports-multiple-host-configuration branch from 9c49e9a to b5b6cdf Compare March 22, 2024 10:31
- Allow to use Mono for user and password
- Add multiple hosts connection strategy
- Add HA protocol support for multiple hosts
- Add DNS SRV driver for HA protocol
@mirromutth mirromutth force-pushed the 89-featuresupports-multiple-host-configuration branch from b5b6cdf to 7c9144a Compare April 5, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error connecting to mysql inside the docker [feature]Supports Multiple host configuration.
1 participant